import React,{useState} from 'react';
import { Table} from 'antd';

const ShopTable = (props) => {
  const {curList,columns}=props
  const [pageSize,setSize]=useState(10)
      // console.log(columns,'curlist')     
      

      const onSelectChange = selectedRowKeys => {
        console.log('selectedRowKeys changed: ', selectedRowKeys);
        this.setState({ selectedRowKeys });
      };
      const handleChange=(pagination)=>{
          console.log(pagination,'pagination')
          setSize(pagination.pageSize)
      }
    return (
        <div>
            <Table 
            columns={columns} 
            dataSource={curList} 
            pagination={{ pageSize:pageSize }} 
            scroll={{ y: 350 }}
            size='small'
            rowKey='id'
            onChange={handleChange}
            // rowSelection={rowSelection}
            />
        </div>
    );
}

export default ShopTable;
